Conversation
- intra-vcp/tuples endpoint now returns bytes instead of JSON (breaking change) - tupleList is serialized to bytes Signed-off-by: Alwin Zomotor <alwin.zomotor@de.bosch.com>
- Castor no longer uses the TupleList class and directly returns bytes retrieved from MinIO Signed-off-by: Alwin Zomotor <alwin.zomotor@de.bosch.com>
Signed-off-by: Alwin Zomotor <alwin.zomotor@de.bosch.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #65 +/- ##
============================================
- Coverage 85.07% 83.24% -1.83%
+ Complexity 300 286 -14
============================================
Files 56 56
Lines 1045 979 -66
Branches 70 63 -7
============================================
- Hits 889 815 -74
- Misses 125 133 +8
Partials 31 31
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
|
There should be separate branches for the individual features |
|
|
||
| import io.carbynestack.castor.common.exceptions.CastorClientException; | ||
|
|
||
| import java.io.ByteArrayOutputStream; |
There was a problem hiding this comment.
If not update Copyright Header
There was a problem hiding this comment.
Please update Copyright header
| } | ||
| } | ||
|
|
||
| public byte[] toByteArray(){ |
There was a problem hiding this comment.
This duplicates code from asChunk(UUID).
Please re-use this method accordingly.
There was a problem hiding this comment.
Please update Copyright header
| byte[].class) | ||
| .get(); | ||
| long length = tupleType.getTupleSize() * count; | ||
| return TupleList.fromStream(tupleType.getTupleCls(), |
There was a problem hiding this comment.
As Tuples as mostly consumed within a stream, it may make sense to keep tuples as a stream (potentially still wrapped as a TupleList and lazily converted later if required).
There was a problem hiding this comment.
maybe TupleList became obsolete
| * @throws InterruptedException : If the fragments can not be reserved | ||
| */ | ||
| @Transactional() | ||
| public void storeReservationInDB(@NotNull Reservation reservation) throws InterruptedException { |
There was a problem hiding this comment.
Am I right that this method requires the reservation elements to be ordered by number of reserved Tuples where all elements with number of tuples < initial fragment size must be listed first.
That feels fragile especially as not properly documented (is it?)
| import io.carbynestack.castor.common.exceptions.CastorServiceException; | ||
| import java.util.function.Supplier; | ||
|
|
||
| import io.micrometer.core.annotation.Timed; |
| static final String ACTIVATION_STATUS_COLUMN = "activation_status"; | ||
| static final String RESERVATION_ID_COLUMN = "reservation_id"; | ||
| static final String VIEW_NAME = "distributed_fragments"; | ||
| static final String POD_HASH_FIELD = "pod_hash"; |
Signed-off-by: Alwin Zomotor <alwin.zomotor@de.bosch.com>
- transaction between two threads - now no longer checks for available tuples and will fail when trying to reserve instead, saving lots of time. Signed-off-by: Alwin Zomotor <alwin.zomotor@de.bosch.com>
- improved reservation locking, still needds to be fixed Signed-off-by: Alwin Zomotor <alwin.zomotor@de.bosch.com>
Signed-off-by: Alwin Zomotor <alwin.zomotor@de.bosch.com>
- now splits tuplechunks correctly if number of tuples % fragmentsize > 0. Signed-off-by: Alwin Zomotor <alwin.zomotor@de.bosch.com>
Signed-off-by: Alwin Zomotor <alwin.zomotor@de.bosch.com>
Signed-off-by: Alwin Zomotor <alwin.zomotor@de.bosch.com>
Signed-off-by: Alwin Zomotor <alwin.zomotor@de.bosch.com>
3ed574f to
516901d
Compare
516901d to
36badbd
Compare
| @@ -1,5 +1,5 @@ | |||
| /* | |||
| * Copyright (c) 2021 - for information on the respective copyright owner | |||
| * Copyright (c) 2024 - for information on the respective copyright owner | |||
There was a problem hiding this comment.
Copyright must be in format
...
Copyright (c) 2021 - 2024 - for information on the respective copyright owner
...
-> Copyright (c) [Year of file added] - [Year last modified] ...
if [Year of file added] is the same as [Year last modified] it is simply
-> Copyright (c) [Year of file added] ...
| .retrieveSinglePartialFragment( | ||
| tupleType, oddToReserve < castorServiceProperties.getInitialFragmentSize()) | ||
| .orElseThrow( | ||
| () -> new CastorServiceException(FAILED_FETCH_AVAILABLE_FRAGMENT_EXCEPTION_MSG)); |
There was a problem hiding this comment.
Is there a test that ensures that all previous reservations are rolled back if there aren't enough tuples available
| TupleChunkFragmentEntity availableFragment = | ||
| fragmentStorageService | ||
| .retrieveSinglePartialFragment( | ||
| tupleType, oddToReserve < castorServiceProperties.getInitialFragmentSize()) |
There was a problem hiding this comment.
second argument preferSmall of retrieveSinglePartialFragment(TupleType tupleType, boolean preferSmall) is always true, does this make sense?
There was a problem hiding this comment.
second argument
preferSmallofretrieveSinglePartialFragment(TupleType tupleType, boolean preferSmall)is always true, does this make sense?
This argument is not always true. oddToReserve may be greater than the initial Fragment size, if Castor couldn't get the whole amount of Tuples in whole fragments. This happened in my test setup because Klyshko had an off-by-one error and would save 99,999 Tuples instead of 100,000 Tuples into a tupleChunk resulting in lots of tuples getting saved in partial fragments.
Line 79 adds the amount of tuples to oddToReserve that should have been reserved as round, couldn't.
|
|
||
| /** | ||
| * Maps the reservation elements to tuplefragments and saves them accordingly in batches to the | ||
| * RDBMS. This function assumes that all 'non-round' fragments are saved before 'round' fragments |
There was a problem hiding this comment.
what means saved? in the database?
There was a problem hiding this comment.
what means saved? in the database?
Yes. Saved means saved in this context (RDBMS) means saved to postgres.
| when(dedicatedTransactionServiceOptionalMock.isPresent()).thenReturn(true); | ||
| when(tupleChunkFragmentStorageServiceMock.retrieveSinglePartialFragment(tupleType, true)) | ||
| .thenReturn(Optional.of(fragmentEntity)); | ||
| // when(castorInterVcpClientSpy.shareReservation(any(Reservation.class))).thenReturn(false); |
No description provided.